<?php

ini_set('display_errors', 1);
ini_set('max_execution_time', 500);
include_once 'lib.php';


$blog_abbrev = $_GET['blog'];
if (is_numeric($blog_abbrev[0])) $blog_abbrev = '_'.$blog_abbrev;
$blog_abbrev = str_replace('.', 'dot', $blog_abbrev);

if (class_exists($blog_abbrev.'_scraper')) eval('$scraper = new '.$blog_abbrev.'_scraper();');
else $scraper = new BlogScraper($blog_abbrev);


if ($_GET['download']) $scraper->download = true;
if ($_GET['updatePost']) $scraper->updatePost = true;
if ($_GET['updateLinks']) $scraper->updateLinks = true;
if ($_GET['url']) $scraper->setURL($_GET['url']);

if ($_GET['overwrite']) $overwrite = true;
else $overwrite = false;


$scraper->scrape();



?>